/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 苏李涛
 * Date: 2024-05-06
 * Time: 20:19
 */
public class My_ToString {
    public static void main(String[] args) {
        String b = "str";
        int a = 10;
        System.out.println(b + a);
    }

    public static String myToString(int[] array) {

        String ret = "[";
        for (int i = 0; i < array.length; i++) {
            ret += array[i];
            if (i < array.length-1)
            ret += ',';
        }
        ret += "]";
        return ret;
    }

    public static void main1(String[] args) {
        int[] array = {1,2,3,4,5};
        System.out.println(myToString(array));
    }
}
